﻿using System;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Equality.Tests
{
    [TestClass]
    public class When_putting_in_hastable
    {
        [TestMethod]
        public void TestMethod1()
        {
            List<Car> cars = new List<Car>();

            var car1
                = new Car() {Name = "F"};
              var car2
                = new Car(){Name = "F"};
            cars.Add(car1);
            cars.Add(car1);
            cars.Add(car2);

            bool res = cars.Contains(car1);

            Assert.IsTrue(res);

            Assert.AreEqual(car1, cars.Find(c=>c.Equals(car1)));
        }
    }
}
